package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.OverFlowDao;
import com.atguigu.jxc.entity.OverflowList;
import com.atguigu.jxc.entity.OverflowListGoods;
import com.atguigu.jxc.service.OverFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class OverFlowServiceImpl implements OverFlowService {
    @Autowired
    private OverFlowDao overFlowDao;
    @Override
    public void save(OverflowList overflowList, String overflowListGoodsStr, String overflowNumber) {

        this.overFlowDao.saveOverFlow(overflowList,overflowListGoodsStr,overflowNumber);
    }

    @Override
    public Map<String, Object> list(String sTime, String eTime) {
        List<OverflowList> OverflowList = overFlowDao.list(sTime, eTime);
        Map<String, Object> map = new HashMap<>();
        map.put("rows", OverflowList);
        return map;
    }

    @Override
    public Map<Object, Object> getListById(Integer overflowListId) {
        List<OverflowListGoods>  OverflowListGoods = overFlowDao.getListById(overflowListId);
        Map<Object, Object> map1 = new HashMap<>();
        map1.put("rows", OverflowListGoods);
        return map1;
    }
}
